﻿using System.Collections.Generic;
using YerongapillyGreens.Web.Extensions;

namespace YerongapillyGreens.Web.Model
{
    public class EmailModel
    {
        public string Name { get; set; }
        public string EmailAddress { get; set; }
        public string Phone { get; set; }
        public string Subject { get; set; }
        public string Message { get; set; }
        public bool RentalEnquiry { get; set; }
        public bool SalesEnquiry { get; set; }
        public List<string> ToAddress { get; set; }

        public EmailModel()
        {
            ToAddress = new List<string>();
        }

        public override string ToString()
        {
            string rtnVal = "";

            if (Name.NotEmpty())
                rtnVal += "<br />From: " + Name;

            if (EmailAddress.NotEmpty())
                rtnVal += "<br />Email: " + EmailAddress;

            if (Phone.NotEmpty())
                rtnVal += "<br />Phone Number: " + Phone;

            if (SalesEnquiry)
                rtnVal += "<br />Sales Enquiry: Yes";
            else
                rtnVal += "<br />Sales Enquiry: No";

            if (RentalEnquiry)
                rtnVal += "<br />Rental Enquiry: Yes";
            else
                rtnVal += "<br />Rental Enquiry: No";


            if (Message.NotEmpty())
                rtnVal += "<br />Message: " + Message;

            return rtnVal;
        }
    }
}